import React from 'react';
import ReactDOM from 'react-dom/client';
import {createStore, applyMiddleware} from 'redux';
import {thunk} from 'redux-thunk';
import {Provider} from 'react-redux';
import "./global.css"
import Routers from "./router/routers";
import rootReducer from "./reduces/index";
import {composeWithDevTools} from 'redux-devtools-extension';
import {ConfigProvider} from 'antd';
import zhCN from 'antd/locale/zh_CN';
import {DevSupport} from "@react-buddy/ide-toolbox";
import {ComponentPreviews, useInitial} from "./dev";
const store = createStore(rootReducer, composeWithDevTools(applyMiddleware(thunk)))
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
    <ConfigProvider locale={zhCN}>
        <DevSupport ComponentPreviews={ComponentPreviews}
                    useInitialHook={useInitial}
        >
            <Provider store={store}>
                {Routers}
            </Provider>
        </DevSupport>
    </ConfigProvider>
);

